<template>
  <div>
    <div style="display: flex;justify-content: space-around;">
      <el-row>
        <el-col>
          <div>
            <el-form-item label="供应商">
              {{ supplierName }}
            </el-form-item>
            <el-form-item label="采购员">
              {{ whoPurchase }}
            </el-form-item>
            <el-form-item label="采购时间">
              {{ purchaseDate }}
            </el-form-item>
          </div>
          <div class="grid-content bg-purple-dark">
            <el-table
                :data="tableData"
                style="width: 100%">
              <el-table-column
                  label="商品名称"
                  prop="productBean.productName"
                  width="160">
              </el-table-column>
              <el-table-column
                  label="厂家"
                  prop="productBean.factory"
                  width="160">
              </el-table-column>
              <el-table-column
                  label="采购价格"
                  prop="productBean.purchasePrice"
                  width="160">
              </el-table-column>
              <el-table-column
                  label="销售价格"
                  prop="inSalePrice"
                  width="160">
              </el-table-column>
              <el-table-column
                  label="采购数量"
                  prop="purchaseNum"
                  width="160">
              </el-table-column>
            </el-table>
          </div>
        </el-col>
      </el-row>
    </div>


  </div>
</template>

<script>
export default {
  name: "PInfoDetail",
  data() {
    return {
      tableData: [],
      supplierName: '',
      whoPurchase: '',
      purchaseDate: ''
    }
  }, methods: {
    showPurchaseByDetail(id) {
      console.log(id)
      let url = "api/purchase/findPurchaseById/" + id
      this.axios.get(url).then(r => {
        console.log(r)
        this.tableData = r.data.purchaseInfoList
        this.supplierName = r.data.supplierBean.supplierName
        this.whoPurchase = r.data.userBean.username
        this.purchaseDate = r.data.purchaseDate
      })
    }
  }
}
</script>

<style scoped>

</style>